% Rastrigin
% this function has global optimal at 0 in range [-10,10]
function result = Rastrigin(x)
result = 0;
len = length(x);
for i = 1:len
    temp = x(i)^2 - 10 * cos(2*pi*x(i)) + 10;
    result = result + temp;
end
end